// 防抖指令(需要传递一个事件名称)
export const shake = {
  mounted: function (el, binding) {
    let timer = null;
    el.addEventListener(binding.arg, (e) => {
      clearTimeout(timer);
      timer = setTimeout(() => {
        binding.value(e.target.value);
      }, 500);
    });
  },
};
